Video Sample Description
The video sample description contains information that defines how to interpret video media data. This sample description is based on the standard sample description header, as described in
"Sample Table Atoms"
.
The Data format field indicates the type of compression that was used to compress the image data.
Table 0-6
shows some of the formats currently supported.
Table 6
Image compression formats
Compression type
|
Description
|
'cvid'
|
Cinepak
|
'jpeg'
|
JPEG
|
'raw '
|
Uncompressed RGB
|
'yuv2'
|
Uncompressed YUV422
|
'smc '
|
Graphics
|
'rle '
|
Animation
|
'rpza'
|
Apple Video
|
'kpcd'
|
Kodak Photo CD
|
'qdgx'
|
QuickDraw GX
|
'mpeg'
|
MPEG still image
|
'mjpa'
|
Motion-JPEG (Format A)
|
'mjpb'
|
Motion-JPEG (Format B)
|
The video media handler also adds some of its own fields to the sample description. For more information about each of these fields, see the discussion of image descriptions in Inside Macintosh: QuickTime.
-
Version
-
A 16-bit integer indicating the version number of the compressed data. Usually this is set to 0, unless a compressor has changed its data format.
-
Revision level
-
A 16-bit integer that must be set to 0.
-
Vendor
-
A 32-bit integer that specifies the developer of the compressor that generated the compressed data. Often this field contains
'appl'
to indicate Apple Computer, Inc.
-
Temporal quality
-
A 32-bit integer containing a value from 0 to 1023 indicating the degree of temporal compression.
-
Spatial quality
-
A 32-bit integer containing a value from 0 to 1023 indicating the degree of spatial compression.
-
Width
-
A 16-bit integer that specifies the width of the source image in pixels.
-
Height
-
A 16-bit integer that specifies the height of the source image in pixels.
-
Horizontal resolution
-
A 32-bit fixed point number containing the horizontal resolution of the image in pixels per inch.
-
Vertical resolution
-
A 32-bit fixed point number containing the vertical resolution of the image in pixels per inch.
-
Data size
-
A 32-bit integer that must be set to 0.
-
Frame count
-
A 16-bit integer that indicates how many frames of compressed data are stored in each sample. Usually set to 1.
-
Compressor name
-
A 32-byte Pascal string containing the name of compressor that created the image, such as
"jpeg"
.
-
Depth
-
A 16-bit integer that indicates the pixel depth of the compressed image. Values of 1, 2, 4, 8,16, 24, and 32 indicate the depth of color images. The value of 32 should be used only if the image contains an alpha channel. Values of 34, 36, and 40 indicate 2-, 4-, and 8-bit grayscale, respectively, for grayscale images.
-
Color table ID
-
A 16-bit integer that identifies which color table to use. If this field is set to -1, the default color table should be used for the specified depth. For all depths below 16 bits per pixel, this indicates a standard Macintosh color table for the specified depth. Depths of 16, 24, and 32 have no color table.
-
If the color table ID is set to 0, a color table is contained within the sample description itself. The color table immediately follows the Color table ID field in the sample description. See
"Color Table Atoms"
for a complete description of a color table.
Video sample descriptions can be extended by appending other atoms. These atoms are placed after the color table, if one is present. These extensions to the sample description may contain display hints for the decompressor or may simply carry additional information associated with the images.
Table 0-7
lists the currently defined extensions to video sample descriptions.
Table 7
Video sample description extensions
Extension type
|
Description
|
'gama'
|
A 32-bit fixed point number indicating the gamma level at which the image was captured. The decompressor can use this value to gamma-correct at display time.
|
'fiel'
|
A 2-byte value indicating the number of video fields in the data stream, and how those fields are to be used. The first byte specifies the field count, and may be set to 1 or 2. The second byte defines the field dominance, as follows:
0-Field dominance unknown
1-Top field is first, temporally
2-Bottom field is first, temporally
This information is used by applications that may be modifying decompressed image data, or by decompressor components to determine field display order.
|
'mjqt'
|
The default quantization table for a Motion JPEG data stream.
|
'mjht'
|
The default Huffman table for a Motion JPEG data stream.
|
© 1997 Apple Computer, Inc.| Previous | Chapter contents | Chapter top | Next |